﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" AutoEventWireup="true" CodeFile="DanhsachMT.aspx.cs" Inherits="admin_DanhsachMT" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script type="text/javascript">
    function isconfirm() {
        var ck = confirm('Bạn có chắc xoá hay không?');
        if (ck == true)
            return true;
        else
            return false;
    }

        </script>

    <form id="form1" runat="server">
    <table style="width:100%;">
        <tr>
            <td style="width: 560px">
            
            <table cellpadding="0" cellpadding="0"  border="1" 
                    style="width: 600px; height: 243px">
                        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" 
                            onitemcommand="Repeater1_ItemCommand">
                        <HeaderTemplate>
                        <tr>
                                    <th align=center>Mã máy</th>
							        <th align=center>Tên máy</th>
							        <th align=center>Giá bán</th>
							        <th align=center>Số lượng</th>
							        <th align=center>Mã HãngSX</th>				
                                    <th align=center>Xoá </th>		
                                    <th align=left  >Sửa </th>
                        </tr>
                            
                        </HeaderTemplate>
               
                        <ItemTemplate>
                        <tr>
                        <td><asp:HyperLink ID="hplMaMay" runat="server" NavigateUrl='<%# "ThemSP.aspx?mamay=" + DataBinder.Eval(Container.DataItem,"mamay")%>' Text='<%# DataBinder.Eval(Container.DataItem,"mamay")%>' /></td>
                                    <td align =left  ><%#Eval("tenmay")%></td>
							        <td align =center><%#Eval("giaban")%></td>
							        <td align =center><%#Eval("soluong")%></td>
							        <td align =center><%#Eval("mahangsx")%></td>
							        <td align =center><asp:ImageButton ID="imagebtxoa" Height="20" Width="20" runat="server" CommandArgument='dk' 
							        CommandName="Xoa" OnClientClick='return isconfirm()'
                                    ImageUrl="images/action_remove.png" /> </td> 
                                 <td>  <a align=left  href="SuaMT.aspx?mamay=<%#Eval("mamay")%>"> <img src="images/action_check.png"  alt ="Check" id ="check" /></img></a></td>
                                    
                          
                         
                        </tr>
                        
                        
                        </ItemTemplate>
               
                 </asp:Repeater> 
                 
      
               
                        
            </table>
                
                
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:maytinhxachtayConnectionString %>" 
                    SelectCommand="SELECT [MaMay], [TenMay], [GiaBan], [SoLuong], [MaHangSX] FROM [MayTinh]">
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 560px">
            
             
               
            
             
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        </table>
    </form>
</asp:Content>

